package com.plugin.manage.pojo.vo;

import com.plugin.core.model.entity.SysMgrUser;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.Builder;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;

/**
 * 系统用户VO类
 * 
 * @author mark
 * @date 2025-07-24
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(name = "SysUserVO", description = "系统用户信息")
public class SysUserVO implements Serializable {

    /**
     * 用户ID
     */
    @Schema(description = "用户ID")
    private Long userId;

    /**
     * 用户名
     */
    @Schema(description = "用户名")
    private String username;

    /**
     * 昵称
     */
    @Schema(description = "昵称")
    private String nickname;

    /**
     * 邮箱
     */
    @Schema(description = "邮箱")
    private String email;

    /**
     * 手机号
     */
    @Schema(description = "手机号")
    private String mobilePhone;

    /**
     * 用户类型
     */
    @Schema(description = "用户类型")
    private Integer userType;

    /**
     * 账户状态
     */
    @Schema(description = "账户状态")
    private Integer accountStatus;

    public static SysUserVO build(SysMgrUser sysUser) {
        return SysUserVO.builder()
            .userId(sysUser.getUserId())
            .username(sysUser.getUsername())
            .nickname(sysUser.getNickname())
            .email(sysUser.getEmail())
            .mobilePhone(sysUser.getMobilePhone())
            .userType(sysUser.getUserType())
            .accountStatus(sysUser.getAccountStatus()).build();
    }

}
